package task

import (

	"EasyData/global"
	_ "github.com/go-sql-driver/mysql"
	"EasyData/to-hbase"
	"EasyData/sqls"
	"EasyData/hbase"
	"sync"
)
/**
	执行任务的一个单元
 */
func RunTask(task *global.Task){

	db := sqls.NewDb(task)
	client := hbase.GetHbaseClient()
	excustor := to_hbase.GetExcustor(task)
	taskStruct := &UnitTask{db,client,excustor,task,false,new(sync.Mutex),false}
	taskStruct.describe()
	QueueManager.RegistTask(taskStruct)

	if "" != task.Cron{
		registCronTask(taskStruct,task)
	}

}

